# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=libdmapsharing
pkgver=2.9.39
pkgrel=3
pkgdesc="A library that implements the DMAP family of protocols"
arch=(x86_64)
url="https://www.flyn.org/projects/libdmapsharing/index.html"
license=(LGPL2.1)
depends=(libsoup avahi gst-plugins-base-libs gdk-pixbuf2)
makedepends=(git gtk-doc gobject-introspection)
_commit=b5af68774d432bbf44ffa552df26665dce1cc155  # tags/LIBDMAPSHARING_2_9_39^0
source=("git+https://gitlab.gnome.org/GNOME/libdmapsharing.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^LIBDMAPSHARING_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --with-mdns=avahi --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
